Optimal. Leaf size=250 \[ \frac {x}{b^4}-\frac {a \left (2 a^6-7 a^4 b^2+8 a^2 b^4-8 b^6\right ) \text {ArcTan}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{(a-b)^{7/2} b^4 (a+b)^{7/2} d}-\frac {a^2 \cos ^2(c+d x) \sin (c+d x)}{3 b \left (a^2-b^2\right ) d (a+b \cos (c+d x))^3}+\frac {a^3 \left (3 a^2-8 b^2\right ) \sin (c+d x)}{6 b^3 \left (a^2-b^2\right )^2 d (a+b \cos (c+d x))^2}-\frac {a^2 \left (9 a^4-28 a^2 b^2+34 b^4\right ) \sin (c+d x)}{6 b^3 \left (a^2-b^2\right )^3 d (a+b \cos (c+d x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.40, antiderivative size = 250, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 6, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {2871, 3110,
3100, 2814, 2738, 211} \begin {gather*} -\frac {a^2 \sin (c+d x) \cos ^2(c+d x)}{3 b d \left (a^2-b^2\right ) (a+b \cos (c+d x))^3}-\frac {a^2 \left (9 a^4-28 a^2 b^2+34 b^4\right ) \sin (c+d x)}{6 b^3 d \left (a^2-b^2\right )^3 (a+b \cos (c+d x))}+\frac {a^3 \left (3 a^2-8 b^2\right ) \sin (c+d x)}{6 b^3 d \left (a^2-b^2\right )^2 (a+b \cos (c+d x))^2}-\frac {a \left (2 a^6-7 a^4 b^2+8 a^2 b^4-8 b^6\right ) \text {ArcTan}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{b^4 d (a-b)^{7/2} (a+b)^{7/2}}+\frac {x}{b^4} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 211
Rule 2738
Rule 2814
Rule 2871
Rule 3100
Rule 3110
Rubi steps
\begin {align*} \int \frac {\cos ^4(c+d x)}{(a+b \cos (c+d x))^4} \, dx &=-\frac {a^2 \cos ^2(c+d x) \sin (c+d x)}{3 b \left (a^2-b^2\right ) d (a+b \cos (c+d x))^3}-\frac {\int \frac {\cos (c+d x) \left (2 a^2-3 a b \cos (c+d x)-3 \left (a^2-b^2\right ) \cos ^2(c+d x)\right )}{(a+b \cos (c+d x))^3} \, dx}{3 b \left (a^2-b^2\right )}\\ &=-\frac {a^2 \cos ^2(c+d x) \sin (c+d x)}{3 b \left (a^2-b^2\right ) d (a+b \cos (c+d x))^3}+\frac {a^3 \left (3 a^2-8 b^2\right ) \sin (c+d x)}{6 b^3 \left (a^2-b^2\right )^2 d (a+b \cos (c+d x))^2}-\frac {\int \frac {2 a^2 b \left (3 a^2-8 b^2\right )+a \left (3 a^4-10 a^2 b^2+12 b^4\right ) \cos (c+d x)-6 b \left (a^2-b^2\right )^2 \cos ^2(c+d x)}{(a+b \cos (c+d x))^2} \, dx}{6 b^3 \left (a^2-b^2\right )^2}\\ &=-\frac {a^2 \cos ^2(c+d x) \sin (c+d x)}{3 b \left (a^2-b^2\right ) d (a+b \cos (c+d x))^3}+\frac {a^3 \left (3 a^2-8 b^2\right ) \sin (c+d x)}{6 b^3 \left (a^2-b^2\right )^2 d (a+b \cos (c+d x))^2}-\frac {a^2 \left (9 a^4-28 a^2 b^2+34 b^4\right ) \sin (c+d x)}{6 b^3 \left (a^2-b^2\right )^3 d (a+b \cos (c+d x))}+\frac {\int \frac {3 a b^2 \left (a^4-2 a^2 b^2+6 b^4\right )+6 b \left (a^2-b^2\right )^3 \cos (c+d x)}{a+b \cos (c+d x)} \, dx}{6 b^4 \left (a^2-b^2\right )^3}\\ &=\frac {x}{b^4}-\frac {a^2 \cos ^2(c+d x) \sin (c+d x)}{3 b \left (a^2-b^2\right ) d (a+b \cos (c+d x))^3}+\frac {a^3 \left (3 a^2-8 b^2\right ) \sin (c+d x)}{6 b^3 \left (a^2-b^2\right )^2 d (a+b \cos (c+d x))^2}-\frac {a^2 \left (9 a^4-28 a^2 b^2+34 b^4\right ) \sin (c+d x)}{6 b^3 \left (a^2-b^2\right )^3 d (a+b \cos (c+d x))}-\frac {\left (a \left (2 a^6-7 a^4 b^2+8 a^2 b^4-8 b^6\right )\right ) \int \frac {1}{a+b \cos (c+d x)} \, dx}{2 b^4 \left (a^2-b^2\right )^3}\\ &=\frac {x}{b^4}-\frac {a^2 \cos ^2(c+d x) \sin (c+d x)}{3 b \left (a^2-b^2\right ) d (a+b \cos (c+d x))^3}+\frac {a^3 \left (3 a^2-8 b^2\right ) \sin (c+d x)}{6 b^3 \left (a^2-b^2\right )^2 d (a+b \cos (c+d x))^2}-\frac {a^2 \left (9 a^4-28 a^2 b^2+34 b^4\right ) \sin (c+d x)}{6 b^3 \left (a^2-b^2\right )^3 d (a+b \cos (c+d x))}-\frac {\left (a \left (2 a^6-7 a^4 b^2+8 a^2 b^4-8 b^6\right )\right ) \text {Subst}\left (\int \frac {1}{a+b+(a-b) x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{b^4 \left (a^2-b^2\right )^3 d}\\ &=\frac {x}{b^4}-\frac {a \left (2 a^6-7 a^4 b^2+8 a^2 b^4-8 b^6\right ) \tan ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{(a-b)^{7/2} b^4 (a+b)^{7/2} d}-\frac {a^2 \cos ^2(c+d x) \sin (c+d x)}{3 b \left (a^2-b^2\right ) d (a+b \cos (c+d x))^3}+\frac {a^3 \left (3 a^2-8 b^2\right ) \sin (c+d x)}{6 b^3 \left (a^2-b^2\right )^2 d (a+b \cos (c+d x))^2}-\frac {a^2 \left (9 a^4-28 a^2 b^2+34 b^4\right ) \sin (c+d x)}{6 b^3 \left (a^2-b^2\right )^3 d (a+b \cos (c+d x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 2.77, size = 227, normalized size = 0.91 \begin {gather*} \frac {6 (c+d x)-\frac {6 a \left (2 a^6-7 a^4 b^2+8 a^2 b^4-8 b^6\right ) \tanh ^{-1}\left (\frac {(a-b) \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {-a^2+b^2}}\right )}{\left (-a^2+b^2\right )^{7/2}}-\frac {2 a^4 b \sin (c+d x)}{(a-b) (a+b) (a+b \cos (c+d x))^3}+\frac {a^3 b \left (7 a^2-12 b^2\right ) \sin (c+d x)}{(a-b)^2 (a+b)^2 (a+b \cos (c+d x))^2}+\frac {a^2 b \left (-11 a^4+32 a^2 b^2-36 b^4\right ) \sin (c+d x)}{(a-b)^3 (a+b)^3 (a+b \cos (c+d x))}}{6 b^4 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.73, size = 361, normalized size = 1.44 Too large to display
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 688 vs.
\(2 (235) = 470\).
time = 0.53, size = 1445, normalized size = 5.78 \begin {gather*} \left [\frac {12 \, {\left (a^{8} b^{3} - 4 \, a^{6} b^{5} + 6 \, a^{4} b^{7} - 4 \, a^{2} b^{9} + b^{11}\right )} d x \cos \left (d x + c\right )^{3} + 36 \, {\left (a^{9} b^{2} - 4 \, a^{7} b^{4} + 6 \, a^{5} b^{6} - 4 \, a^{3} b^{8} + a b^{10}\right )} d x \cos \left (d x + c\right )^{2} + 36 \, {\left (a^{10} b - 4 \, a^{8} b^{3} + 6 \, a^{6} b^{5} - 4 \, a^{4} b^{7} + a^{2} b^{9}\right )} d x \cos \left (d x + c\right ) + 12 \, {\left (a^{11} - 4 \, a^{9} b^{2} + 6 \, a^{7} b^{4} - 4 \, a^{5} b^{6} + a^{3} b^{8}\right )} d x - 3 \, {\left (2 \, a^{10} - 7 \, a^{8} b^{2} + 8 \, a^{6} b^{4} - 8 \, a^{4} b^{6} + {\left (2 \, a^{7} b^{3} - 7 \, a^{5} b^{5} + 8 \, a^{3} b^{7} - 8 \, a b^{9}\right )} \cos \left (d x + c\right )^{3} + 3 \, {\left (2 \, a^{8} b^{2} - 7 \, a^{6} b^{4} + 8 \, a^{4} b^{6} - 8 \, a^{2} b^{8}\right )} \cos \left (d x + c\right )^{2} + 3 \, {\left (2 \, a^{9} b - 7 \, a^{7} b^{3} + 8 \, a^{5} b^{5} - 8 \, a^{3} b^{7}\right )} \cos \left (d x + c\right )\right )} \sqrt {-a^{2} + b^{2}} \log \left (\frac {2 \, a b \cos \left (d x + c\right ) + {\left (2 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} - 2 \, \sqrt {-a^{2} + b^{2}} {\left (a \cos \left (d x + c\right ) + b\right )} \sin \left (d x + c\right ) - a^{2} + 2 \, b^{2}}{b^{2} \cos \left (d x + c\right )^{2} + 2 \, a b \cos \left (d x + c\right ) + a^{2}}\right ) - 2 \, {\left (6 \, a^{10} b - 23 \, a^{8} b^{3} + 43 \, a^{6} b^{5} - 26 \, a^{4} b^{7} + {\left (11 \, a^{8} b^{3} - 43 \, a^{6} b^{5} + 68 \, a^{4} b^{7} - 36 \, a^{2} b^{9}\right )} \cos \left (d x + c\right )^{2} + 15 \, {\left (a^{9} b^{2} - 4 \, a^{7} b^{4} + 7 \, a^{5} b^{6} - 4 \, a^{3} b^{8}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{12 \, {\left ({\left (a^{8} b^{7} - 4 \, a^{6} b^{9} + 6 \, a^{4} b^{11} - 4 \, a^{2} b^{13} + b^{15}\right )} d \cos \left (d x + c\right )^{3} + 3 \, {\left (a^{9} b^{6} - 4 \, a^{7} b^{8} + 6 \, a^{5} b^{10} - 4 \, a^{3} b^{12} + a b^{14}\right )} d \cos \left (d x + c\right )^{2} + 3 \, {\left (a^{10} b^{5} - 4 \, a^{8} b^{7} + 6 \, a^{6} b^{9} - 4 \, a^{4} b^{11} + a^{2} b^{13}\right )} d \cos \left (d x + c\right ) + {\left (a^{11} b^{4} - 4 \, a^{9} b^{6} + 6 \, a^{7} b^{8} - 4 \, a^{5} b^{10} + a^{3} b^{12}\right )} d\right )}}, \frac {6 \, {\left (a^{8} b^{3} - 4 \, a^{6} b^{5} + 6 \, a^{4} b^{7} - 4 \, a^{2} b^{9} + b^{11}\right )} d x \cos \left (d x + c\right )^{3} + 18 \, {\left (a^{9} b^{2} - 4 \, a^{7} b^{4} + 6 \, a^{5} b^{6} - 4 \, a^{3} b^{8} + a b^{10}\right )} d x \cos \left (d x + c\right )^{2} + 18 \, {\left (a^{10} b - 4 \, a^{8} b^{3} + 6 \, a^{6} b^{5} - 4 \, a^{4} b^{7} + a^{2} b^{9}\right )} d x \cos \left (d x + c\right ) + 6 \, {\left (a^{11} - 4 \, a^{9} b^{2} + 6 \, a^{7} b^{4} - 4 \, a^{5} b^{6} + a^{3} b^{8}\right )} d x - 3 \, {\left (2 \, a^{10} - 7 \, a^{8} b^{2} + 8 \, a^{6} b^{4} - 8 \, a^{4} b^{6} + {\left (2 \, a^{7} b^{3} - 7 \, a^{5} b^{5} + 8 \, a^{3} b^{7} - 8 \, a b^{9}\right )} \cos \left (d x + c\right )^{3} + 3 \, {\left (2 \, a^{8} b^{2} - 7 \, a^{6} b^{4} + 8 \, a^{4} b^{6} - 8 \, a^{2} b^{8}\right )} \cos \left (d x + c\right )^{2} + 3 \, {\left (2 \, a^{9} b - 7 \, a^{7} b^{3} + 8 \, a^{5} b^{5} - 8 \, a^{3} b^{7}\right )} \cos \left (d x + c\right )\right )} \sqrt {a^{2} - b^{2}} \arctan \left (-\frac {a \cos \left (d x + c\right ) + b}{\sqrt {a^{2} - b^{2}} \sin \left (d x + c\right )}\right ) - {\left (6 \, a^{10} b - 23 \, a^{8} b^{3} + 43 \, a^{6} b^{5} - 26 \, a^{4} b^{7} + {\left (11 \, a^{8} b^{3} - 43 \, a^{6} b^{5} + 68 \, a^{4} b^{7} - 36 \, a^{2} b^{9}\right )} \cos \left (d x + c\right )^{2} + 15 \, {\left (a^{9} b^{2} - 4 \, a^{7} b^{4} + 7 \, a^{5} b^{6} - 4 \, a^{3} b^{8}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{6 \, {\left ({\left (a^{8} b^{7} - 4 \, a^{6} b^{9} + 6 \, a^{4} b^{11} - 4 \, a^{2} b^{13} + b^{15}\right )} d \cos \left (d x + c\right )^{3} + 3 \, {\left (a^{9} b^{6} - 4 \, a^{7} b^{8} + 6 \, a^{5} b^{10} - 4 \, a^{3} b^{12} + a b^{14}\right )} d \cos \left (d x + c\right )^{2} + 3 \, {\left (a^{10} b^{5} - 4 \, a^{8} b^{7} + 6 \, a^{6} b^{9} - 4 \, a^{4} b^{11} + a^{2} b^{13}\right )} d \cos \left (d x + c\right ) + {\left (a^{11} b^{4} - 4 \, a^{9} b^{6} + 6 \, a^{7} b^{8} - 4 \, a^{5} b^{10} + a^{3} b^{12}\right )} d\right )}}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 531 vs.
\(2 (235) = 470\).
time = 0.53, size = 531, normalized size = 2.12 \begin {gather*} \frac {\frac {3 \, {\left (2 \, a^{7} - 7 \, a^{5} b^{2} + 8 \, a^{3} b^{4} - 8 \, a b^{6}\right )} {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (-2 \, a + 2 \, b\right ) + \arctan \left (-\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\sqrt {a^{2} - b^{2}}}\right )\right )}}{{\left (a^{6} b^{4} - 3 \, a^{4} b^{6} + 3 \, a^{2} b^{8} - b^{10}\right )} \sqrt {a^{2} - b^{2}}} - \frac {6 \, a^{8} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 15 \, a^{7} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 6 \, a^{6} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 45 \, a^{5} b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 6 \, a^{4} b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 60 \, a^{3} b^{5} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 36 \, a^{2} b^{6} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 12 \, a^{8} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 56 \, a^{6} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 116 \, a^{4} b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 72 \, a^{2} b^{6} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 6 \, a^{8} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 15 \, a^{7} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 6 \, a^{6} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 45 \, a^{5} b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 6 \, a^{4} b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 60 \, a^{3} b^{5} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 36 \, a^{2} b^{6} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{{\left (a^{6} b^{3} - 3 \, a^{4} b^{5} + 3 \, a^{2} b^{7} - b^{9}\right )} {\left (a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a + b\right )}^{3}} + \frac {3 \, {\left (d x + c\right )}}{b^{4}}}{3 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 12.37, size = 2500, normalized size = 10.00 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________